package com.example.blog.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 管理人员表(ManageInfo)实体类
 *
 * @author makejava
 * @since 2021-08-10 16:14:20
 */
@Table(name = "userInfo")
@Data
@Slf4j
@Entity
@Builder
@DynamicInsert
@DynamicUpdate
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo implements Serializable {
    private static final long serialVersionUID = -25645818464625208L;
    /**
     * 用户id
     */
    @Id
    @GeneratedValue(generator = "faceset_generator")
    @GenericGenerator(name = "faceset_generator", strategy = "uuid")
    @Column(name = "id",nullable = false,columnDefinition = "varchar(64) not null comment '主键id'")
    private String id;
    /**
     * 账号
     */
    @Column(name = "username",columnDefinition ="varchar(128) not null comment '用户名'")
    private String username;
    /**
     * 账号
     */
    @Column(name = "nickName",columnDefinition ="varchar(128)  comment '昵称'")
    private String nickName;
    /**
     * 密码
     */
    @Column(name = "password",columnDefinition ="varchar(128)  comment '密码，MD5'")
    private String password;
    /**
     * 手机号码
     */
    @Column(name = "telephone",columnDefinition ="varchar(128)  comment '手机号码'")
    private String telephone;
    /**
     * 注册时间
     */
    @Column(name = "addTime",columnDefinition ="datetime  comment '注册时间'")
    private Date addTime;
    /**
     * 登录时间
     */
    @Column(name = "loginTime",columnDefinition ="datetime comment '登录时间'")
    private Date loginTime;
    /**
     * 邮箱
     */
    @Column(name = "email",columnDefinition ="varchar(56)  comment '邮箱'")
    private String email;
    /**
     * 账号状态0--在线 1--下线 2--封号 3--销号（不可恢复）
     */
    @Column(name = "status",columnDefinition ="varchar(1)  comment '账号状态0--在线 1--下线 2--封号 3--销号（不可恢复）'")
    private String status;
    /**
     * 下线时间
     */
    @Column(name = "offTime",columnDefinition ="datetime  comment '下线时间'")
    private Date offTime;
    /**
     * 登录ip
     */
    @Column(name = "loginIp",columnDefinition ="varchar(128)  comment '登录ip'")
    private String loginIp;
    /**
     * 在线时长
     */
    @Column(name = "onlineTime",columnDefinition ="datetime  comment '在线时长'")
    private Date onlineTime;
    /**
     * 在线时长
     */
    @Column(name = "userType",columnDefinition ="int(1)  comment '用户类型 1--普通用户 2--管理员'")
    private Integer userType;

}
